package com.dogcatfishdish.containers
{
	import flash.display.DisplayObjectContainer;
	import flash.events.IEventDispatcher;
	
	public interface IScreenManager extends IEventDispatcher
	{
		/**
		 * Adds IScreen instances to the stack in order. Calling this again appends to the screen list.
		 * 
		 * @param params 
		 */		
		function addScreens(...params):void;
		
		/**
		 * Remove an IScreen from the list
		 *  
		 * @param screen IScreen instance to remove.
		 * 
		 */		
		function removeScreen(screen:IScreen):void;
		
		/**
		 * Moves to the next screen in the list. 
		 */		
		function nextScreen():void;

		/**
		 * Moves to the previous screen in the list.
		 */				
		function previousScreen():void;
		
		/**
		 * Callback method called nextScreen() is called on the last IScreen in the list.
		 * 
		 * @param func
		 */		
		function set onCompleted(func:Function):void;
		
		/**
		 * Callback function called when the screen has changed after calling nextScreen() or previousScreen().
		 *  
		 * @param func
		 */		
		function set onChanged(func:Function):void;
		
		/**
		 * Returns the current view DisplayObjectContainer. Throws ScreenManagerError.NO_VIEW if no view is defined.
		 * 
		 * @return 
		 * 
		 */		
		function get view():DisplayObjectContainer;
		
		/**
		 * Sets the view instance.
		 *  
		 * @param value
		 * 
		 */		
		function set view(value:DisplayObjectContainer):void;
	}
}